﻿using System.IO;
using System.Security.Principal;
using System.Web;
using System.Web.Hosting;

namespace nanoCMS.Core.Test
{
    public class Helpers
    {
        public static HttpContext FakeHttpContext(string username)
        {
            SimpleWorkerRequest request = new SimpleWorkerRequest("/dummy", @"c:\inetpub\wwwroot\dummy", "dummy.html", null, new StringWriter());
            HttpContext context = new HttpContext(request) { User = new GenericPrincipal(new GenericIdentity(username), new string[0]) };
            return context;
        }
    }
}
